on *:TEXT:!cguess*:#:{ 
  if (%numberzz == $null) goto this
  if (%numberzz != $null) goto that 
  :this
  msg $chan $nick has started a cookie guessing game! guess by saying !cg NUMBER.
  set %numberzz $rand(0,100)
  echo 3 -a %numberzz
  .notice Sephiroth1n6 the answer is %numberzz
  halt
  :that
  .notice $nick a game is in progress. please wait until the game is over, or you could just type !stopcookie
  halt
}
on *:TEXT:!stopcookie*:#:{ 
  if (%numberz != $null) goto not
  if (%numberz == $null) goto yup
  :not
  msg $chan Cookie Guessing Stopped By $nick $+ . The Answer Was %numberz $+ .
  unset %numberzz
  halt
  :yup
  .notice $nick There Is Currently No Game In Progress.
  halt
}
on *:TEXT:!cg *:#:{
  if ($2 > %numberzz) goto greater
  if ($2 < %numberzz) goto lesser
  if ($2 == %numberzz) goto equal
  if (%numberzz == $null) goto whom
  else goto what
  :greater
  msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Lower Number!
  halt
  :lesser
  msg $chan $nick $+ , That Answer Was Wrong! But Keep Guessing. Try a Higher Number!
  halt
  :equal
  msg $chan $nick Guessed The Correct Number of cookies, %numberzz and gets to eat them all!!!
  unset %numberzz    
  halt
  :what
  halt
  :whom .notice $nick there is currently no game in progress. Type !cguess to start a game.
  halt
}
